import socket

""" 
A simple echo server 
""" 

HOST = ''
PORT = 8001
BACKLOG = 5
SIZE = 1024

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind((HOST, PORT))
sock.listen(BACKLOG)
while 1:
    client, addr = sock.accept()
    data = client.recv(SIZE)
    if data:
        client.send(data)
    client.close()

